home *** CD-ROM | disk | FTP | other *** search
/ Young Minds / Young Minds Interactive CD-ROM.ISO / kriegspi / error.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-06-30  |  446 b   |  32 lines

  1. #ifndef lint
  2. static char rcsid[] = "$Header: error.c,v 1.3 87/02/12 10:57:44 schoch Exp $";
  3. #endif
  4.  
  5. #include "externs.h"
  6. #include <errno.h>
  7. #include <signal.h>
  8.  
  9. error (s)
  10.     char *s;
  11. {
  12. #ifndef XKS
  13.     clear();
  14.     refresh();
  15.     endwin();
  16. #endif
  17.     if (errno == EPIPE)
  18.         dead = TRUE;
  19.     else {
  20.         if (s != (char *) NULL)
  21.             if (errno)
  22.                 perror (s);
  23.             else
  24.                 fprintf(stderr, "%s\n", s);
  25.         if (out)
  26.             fclose(out);
  27.         if (inp)
  28.             fclose(inp);
  29.         exit (0);
  30.     }
  31. }
  32.